package com.xz.realdemo.factory;

import com.xz.realdemo.entity.database.mysql.MysqlConnection;
import com.xz.realdemo.entity.database.mysql.MysqlStatement;
import com.xz.realdemo.model.Connection;
import com.xz.realdemo.model.Statement;

/**
 * @author 张志航     
 * @version V1.0.0
 * @projectName design_mode
 * @title     MysqlDatabaseFactory   
 * @package    com.xz.realdemo.factory  
 * @date   2019/11/27 11:51  
 * @explain
 */
public class MysqlDatabaseFactory implements DatabaseFactory {
    @Override
    public Connection createConnection() {
        return new MysqlConnection();
    }

    @Override
    public Connection createConnection(String ip, String port) {
        Connection connection = new MysqlConnection();
        connection.setIp(ip);
        connection.setPort(port);
        return connection;
    }

    @Override
    public Statement createStatement() {
        return new MysqlStatement();
    }
}
